class com.whocore.Flashwork {
	
  var development:Boolean = false;
  var serverRoot:String;
  
  
  function Flashwork(development:Boolean,serverRoot:String) {
	  this.development = development;
	  this.serverRoot = serverRoot;
	  trace("INIT FLASHWORK: DEVELOPEMENT: " + development)
  }


  //PRIVATE


  private function local(){
	  
	  var zona = _root._url;
	  var j = zona.substring(0,7);
	  if(j == 'http://')
		return true;
	  else
		return false;
	  
  }
  
  private function fdebug(txt:String){
	_root.debug_txt.text = txt;
  }
  
  
  
  //PUBLIC


  function alert(arr:Array,campo:String){
	  
	  trace("ARRAY: " + arr)
	  trace("----------")
		var i:Number=0;
		
		  for(i in arr){
			trace(i + " => " + arr[i] + "  CAMPO:  " + arr[i][campo])
		}
		  
	  trace("----------")
	  
  }
  
  
  
  function noCache(){
	  if(development==true)
		return "?random=" + Math.random()*100;
	  else
		return "";
  }
  
  
  function openWindow(url:String,Settings:Object){
	  
	  if(!Settings){
		var Settings:Object = new Object()
		Settings.height = "520"
		Settings.width = "680"
		Settings.top = "100"
		Settings.left = "110"
		Settings.toolbar = "no"
	    Settings.scrollBars = "yes"
	  }
	  
	  
	  if(local())
		getURL("javascript:window.open(\'" + url + "\',\'thewin\',\'height=" + Settings.height + ",width=" + Settings.width + ",top=" + Settings.top + ",left=" + Settings.left + ",toolbar=" + Settings.toolbar + ",scrollBars=" + Settings.scrollBars + ",\'); void(0);");
	  else
		trace("URL: " + url + " zona " + local() )
	
  }
  
  
  function openPage(url:String){
	  
	  if(local())
		getURL(url,"_blank");
	  else
		trace("URL: " + url + " zona " + local() )
	
  }


}